<template>
	<view>
		<view class="tabbar flex f-a-c j-s-a">
			<view v-for="(item,index) in list" :key="index" class="flex f-e j-c-c f12" @click="handTab(item,index)">
				<i class="iconfont flex j-c-c f22" :class="index == active?item.icons:item.icon"/>
				<text class="mt6">{{item.name}}</text>
			</view>
		</view>
	</view>
</template>

<script>
export default {
  name:'tabbar',
	props:{
	  active:{
	    type: [String,Number],
	    default: 0
	  }
	},
	data() {
	  return {
	    user: wx.getStorageSync('userInfo'),
	    list:[{
	      name:'签收列表',
	      icon: 'icon-order',
	      icons: 'icon-order_cur color-theme',
	      url: '/pages/index/index?type=sing',
	      type: 3
	    },{
	      name:'个人中心',
	      icon: 'icon-my',
	      icons: 'icon-my_cur color-theme',
	      url: '/pages/my/index',
	      type: 3
	    }]
	  };
	},
	created() {
		if(this.user.type == 2){
			this.list[0] = {
				name:'发货列表',
				icon: 'icon-order',
				icons: 'icon-order_cur color-theme',
				url: '/pages/index/index?type=send',
				type: 3
			}
		}
	},
  methods:{
    handTab(item,i){
      this.util.go(item.url,item.type)
    }
  }
}
</script>

<style lang="scss">
	.tabbar{
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		width: 100%;
		height: 88rpx;
		background: #fff;
		padding: 10rpx;
		line-height: 1;
	}
</style>